[DIT-12085] Add tests for JSONFormatter and account for pluralForm#134
Merged
bparrish17 merged 8 commits intomasterfrom Jan 14, 2026
Conversation
… items and components.
… correct developer ID key in json formatter tests
Contributor
marla-hoggard
left a comment
There was a problem hiding this comment.
Looks good! Just a couple nits.
This relies on changes from the API which are also still open in a PR, so we'll need to wait for that one to deploy before publishing this to NPM. We could merge this without publishing, but probably safest to wait and do it all at once.
lib/src/http/components.test.ts
Outdated
| @@ -73,6 +74,7 @@ describe("fetchComponents", () => { | |||
| id: "text1", | |||
Contributor
There was a problem hiding this comment.
Suggested change
| id: "text1", | |
| id: "text1_one", |
lib/src/http/types.ts
Outdated
|
|
||
| export const ZTextPluralType = z | ||
| .enum(["zero", "one", "two", "few", "many", "other"]) | ||
| .nullable(); |
Contributor
There was a problem hiding this comment.
Nit: Can we remove nullable() from here so that ZTextPluralType is enum, and instead apply nullable() on line 38? That's consistent with the typing in the main app.
marla-hoggard
approved these changes
Jan 13, 2026
…idual plural type
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
JSONFormatterclassContext
DIT-12085: CLI: Update default JSON formatter to write plurals to JSON files
Test Plan
Setup
🚨 Make sure you're working off of the backend branch with the relevant API changes
Have a basic config set up, e.g.
yarn syncat the root of the CLI directory, this should pull from your local Ditto environmentmy-developer-id_manymy-developer-id_many